package com.qiwenshare.ufop.emuns;

import lombok.Getter;

/**
 * 存储类型枚举
 */
@Getter
public enum StorageTypeEnum {

    LOCAL(0, "本地存储"),

    ALIYUN_OSS(1, "阿里云OSS对象存储"),

    FAST_DFS(2, "fastDFS集群存储"),

    MINIO(3, "minio存储"),

    QINIUYUN_KODO(4, "七牛云KODO对象存储"),

    TENCENT_COS(5, "腾讯云COS对象存储");

    private final int code;
    private final String name;

    StorageTypeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static StorageTypeEnum getEnum(int storageType) {
        for (StorageTypeEnum storageTypeEnum : values()) {
            if (storageTypeEnum.code == storageType) {
                return storageTypeEnum;
            }
        }
        return null;
    }
}
